a = {"zero":0,"one":1,"two":2, "three":3, "four":4, "five":5, "six":5, "seven":7, "eight":8, "nine":9
c = input()
k = c.split(" ")
p = ""
prost = [2]
n = 1001
for i in range(100, n+1):
     ksun = 0
     for j in prost:
         if i %j==0:
             ksun=1
     if ksun==0:
         prost.append(i)
for i in range(len(k)):
     l = k[i]
     p = p + str(a[l])
p = int (p)
if p in prost:
     print(p)
else:
    prost.append(p)
    print(sorted(prost))
    for i in range(len(prost)):
        if p in prost:
            print(prost[i])
